
package com.cxx.food.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonView;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.Getter;
import lombok.Setter;

import java.util.Date;

@Getter
@Setter
@JsonView(PlainView.class)
public class CommentDto {
    @Schema(description = "id")
    @JsonView(ReadView.class)
    private Long id;

    @Schema(description = "姓名")
    @JsonView(ReadView.class)
    private String username;

    @Schema(description = "头像")
    @JsonView(ReadView.class)
    private String avatar;

    @Schema(description = "评论内容")
    @NotBlank(message = "内容不能为空")
    private String content;

    @Schema(description = "时间")
    @JsonView(ReadView.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date date;
}
